﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AlumniProject.Ultility;

namespace AlumniProject
{
    public partial class CuuSinhVien : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string s = (this.Request.Params["Id"] as string);
                if (s == null || s.Equals(""))
                {
                    //dan den trang chu
                }
                else
                {
                    //load chi tiet
                    LoadChiTietSV(int.Parse(s));;
                }
            }

        }

        void LoadChiTietSV(int Id)
        {
            DataSet ds = new CuuSV_Utility().Load_DSCSV(Id);
            if (ds !=null && ds.Tables.Count > 0)
            {
                //ok
                DataTable dt = ds.Tables[0];
                imgHinhDaiDien.ImageUrl = ""+dt.Rows[0]["AnhDaiDien"];

                //ten
                lblTen.Text = "" + dt.Rows[0]["HoTen"];
                //lop
                lblLop.Text = "" + dt.Rows[0]["TenLop"];
                //khoa
                lblKhoa.Text = "" + dt.Rows[0]["TenKhoa"];
                //so dien thoai
                lblSDT.Text = "" + dt.Rows[0]["SDT"];
                //lv cong tac
                lblLVCongTac.Text = "" + dt.Rows[0]["TenLV_CT"];
                lblNgaySinh.Text = "" + dt.Rows[0]["NgaySinh"];
                lblSoNha.Text = "" + dt.Rows[0]["SoNha"];
            }
        }
    }
}